package com.oristand.sqlmonitor.config;

/**
 * 数据源上下文
 *
 * @author wangmeng
 * @since 2023/7/5
 */
public class DatasourceContextHolder {

    private static final ThreadLocal<String> dataSourceKey = new ThreadLocal<>();

    public static void setDataSourceKey(String key) {
        dataSourceKey.set(key);
    }

    public static String getDataSourceKey() {
        return dataSourceKey.get();
    }

    public static void clearDataSourceKey() {
        dataSourceKey.remove();
    }
}
